package com.zzyl.nursing.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Slf4j
@Component("mytask")
public class Mytask {
   // @Scheduled(cron = "0/5 * * * * ? ")
    //若依框架中有只需要将 @EnableScheduling 注解添加到启动类中即可 并将当前任务类的全类名添加到常量白名单中即可
    public void execute(){
       log.info("定时任务执行了{}", LocalDateTime.now());
    }
}
